﻿using ReflectionStudio.Components.UserControls;
using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace WPFExcelReport
{
    public partial class MainWindow : DocumentBase
    {
        VVAART vm;
        public MainWindow()
        {
            vm = new VVAART();
            DataContext = vm;
            InitializeComponent();  
            this.Name = "管理"; 
        }
        ViewBase ui;
      
        public override void OnWorkflowIDChange(MessageEventArgs e)
        {
            base.OnWorkflowIDChange(e);
            string wfid = e.Info.Details;
            
             switch (wfid)
            {
                case "GS02":
                    MainTab.Children.Clear();
                    ui = new TSJHGS02();
                    ui.ORDERNUM = e.Info.ORDER;
                    MainTab.Children.Add(ui);
                    break;
                case "KD02":
                    ui = new TKDSTAMM();

                    ((TKDSTAMM)ui).KUNDNR = e.Info.ORDER;
                    MainTab.Children.Add(ui);
                    break;
                case "FVA06":
                    MainTab.Children.Clear();
                    ui = new TPFVA06();
                    MainTab.Children.Add(ui);
                    break;
                case "DVA02":
                    MainTab.Children.Clear();
                    ui = new TDVA02();
                    MainTab.Children.Add(ui);
                    break;
            } 

        }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        { 
            
        } 
        
    }
}
